function ToolsController(){
	
	this.moveControl = document.getElementById('move');
	this.rotateControl = document.getElementById('rotate');
	this.scaleControl = document.getElementById('scale');
	this.deleteControl = document.getElementById('delete');
	this.copyControl = document.getElementById('copy');
	this.init();
}

ToolsController.prototype.init = function(){
	// var moveControl = document.getElementById('move');
	// var rotateControl = document.getElementById('rotate');
	// var scaleControl = document.getElementById('scale');
	// var deleteControl = document.getElementById('delete');
	// var copyControl = document.getElementById('copy');

	this.moveControl.addEventListener('click',function(){control.setMode( "translate" );});
	this.rotateControl.addEventListener('click',function(){control.setMode( "rotate" );});
	this.scaleControl.addEventListener('click',function(){control.setMode( "scale" );});

	this.deleteControl.addEventListener('click',function(evt){
		if(manager.getObjectNumber() <= 0){
			alert("场景中还没有模型!");
		} 
		else if(control.object == null || control.object == undefined || control.object.name == "quanyuenull"){
			alert("您没有选中任何物体!");
		}
			else{
				var ifDelete = confirm("您确定删除"+ activeObject.name +"(当前被选中物体)吗？");
				if(ifDelete){
					if(activeObject.controlGeometry != null && activeObject.controlGeometry != undefined){
						for(index in activeObject.controlGeometry){
							scene.remove(activeObject.controlGeometry[index]);
						}
					}
					scene.remove(activeObject);
					propertyPanel.clean();
					materialPanel.clean();
					
					outliner.removeOutlinerItem(activeObject.id);
					
					control.object = undefined;
					// var temp = new THREE.Object3D();
					// control.attach(temp);
					control.visible = false;
					// control.object.name = "quanyuenull";
					activeObject = new THREE.Object3D();
					modifierViewer.update();
    				modifierSelectorViewer.update();
			}
			
			return;
		}
		
	});
	
	this.copyControl.addEventListener('click',function(evt){
		if(manager.getObjectNumber() <= 0){
			
			alert("场景中还没有模型!");
		} 
		else if(control.object == null || control.object == undefined || control.object.name == "quanyuenull"){
			alert("您没有选中任何物体!");
		}
		else{
			var original = activeObject;
					switch (original.type) {
					
						case "Mesh":
							activeObject = original.clone();
							// console.log(activeObject.gui);
							// if(activeObject.geometry === original.geometry){
							// 	console.log('两者的几何体完全一样');
							// }
							
							var gui = new dat.GUI({autoPlace: false});
							activeObject.gui = gui;
							console.log("这里说明程序执行了");
							// console.log(original.geometry.width);
							activeObject.name = original.name + "_副本";
							// console.log(activeObject.id);
							outliner.addOutlinerItem(activeObject.name,activeObject.id);
							manager.buildGeometryGeneral(activeObject);
							if(activeObject.name.indexOf("立方体") >= 0){
								guis.BoxClone(original,activeObject);
							}
								
							else if(activeObject.name.indexOf("球体") >= 0){
								guis.SphereClone(original,activeObject);
							}
							else if(activeObject.name.indexOf("圆柱体") >= 0){
								guis.CylinderClone(original,activeObject);
							}
							else{
								// guis.BoxClone(original,activeObject);
								guis.PlaneClone(original,activeObject);;
							}
							
							activeObject.visible = original.visible;
							activeObject.castShadow = original.castShadow;
							activeObject.receiveShadow = original.receiveShadow;
							guis.GeometryGeneral(activeObject);
							propertyPanel.update();
							
							manager.cloneMaterialModifier(original,activeObject);
							if(activeObject.material === original.material){
								console.log('两者的材质完全一样');
							}
    						materialPanel.update();
							control.attach(activeObject);
							activeObject.position.setX(activeObject.position.x+10);
							modifierViewer.update();
    						modifierSelectorViewer.update();
							scene.add(activeObject);
							break;
						default:
							alert("目前只能复制模型");
							break;
					}
					
					// control.visible = false;
			
		}
		return;
	});
}